/**
 * Created by Dima on 15.01.2015.
 */

$(document).ready(function(){
    manager.fetchPosts();
});

function toggleComments(postId){
    var comments = $("#comments_to_post_" + postId);
    if (comments.hasClass("opened")) {
        comments.removeClass("opened");
        comments.html("");
    } else {
        manager.showComments(postId);
    }
};

function toggleEditForm(postId){
    var editForm = $("#edit_form_" + postId);
    if (editForm.hasClass("opened")) {
        editForm.removeClass("opened");
        editForm.html("");
    } else {
        manager.showEditForm(postId);
    }
};
